package com.xiaodu.acer.phoneplay.presenter;

import com.xiaodu.acer.phoneplay.bean.IndexBean;
import com.xiaodu.acer.phoneplay.common.rx.RxHttpReponseCompat;
import com.xiaodu.acer.phoneplay.common.rx.subscriber.ProgressSubcriber;
import com.xiaodu.acer.phoneplay.data.AppInfoModel;
import com.xiaodu.acer.phoneplay.presenter.contract.AppInfoContract;
import com.xiaodu.acer.phoneplay.ui.base.BasePresenter;

import javax.inject.Inject;


/**
 * @author 小杜 QQ:1392229149
 * @name phone
 * @class name：com.xiaodu.acer.phoneplay.presenter.contract
 * @class describe
 * @time 2018/1/6 22:33
 * @change
 * @chang time
 * @class describe
 */
public class RecommendPresenter extends BasePresenter<AppInfoModel, AppInfoContract.View> {

    @Inject
    public RecommendPresenter(AppInfoModel model, AppInfoContract.View view) {
        super(model, view);
    }

    //获取数据
    public void requestDatas() {
        mModel.index()
                .compose( RxHttpReponseCompat.<IndexBean>compatResult())
                .subscribe(new ProgressSubcriber<IndexBean>(mContext, mView) {
                    @Override
                    public void onNext(IndexBean indexBean) {
                        mView.showResult(indexBean);
                    }
                });

    }


}
